ZZZ Projects Z.BulkOperations v2.9.39 Retail

Extend and Overcome SqlBulkCopy Limitations with Must-Have Features

High Performance Operations

Use scalable bulk operations (Bulk Insert, Update, Delete, and Merge) and always get the best performance available for your database provider.



Output Identity Value

Overcome SqlBulkCopy limitations and use flexible features to output inserted identity and concurrency column values.

var bulk = new BulkOperation(connection)
                    
                    // Output newly inserted identity value after an insert
                    bulk.ColumnMappings.Add("CustomerID", ColumnMappingDirectionType.Output);
                    
                    bulk.BulkInsert(dt);

 

Insert, Update, Delete, Merge and more...

Bulk Operations is not only about inserting, get morecapability over SqlBulkCopy.

// Support all type of operations
                            var bulk = new BulkOperation(connection);
                            bulk.BulkInsert(dt);
                            bulk.BulkUpdate(dt);
                            bulk.BulkDelete(dt);
                            bulk.BulkMerge(dt);
                            bulk.BulkSaveChanges(ds);
                            bulk.BulkSynchronize(dt);

 

Generic List<> as DataSource

Improve code maintainability by using strongly-typed lambda expression over hard coded string.

var bulk= new BulkOperation<Customer>(connection);
                                    bulk.DestinationTableName = "Customer";
                                    
                                    // Column Columns to Input
                                    bulk.ColumnInputExpression = c => new { c.Code, c.Name };
                                    
                                    // Choose Columns to Output
                                    bulk.ColumnOutputExpression = c => c.CustomerID;
                                    
                                    // Choose Key to Use
                                    bulk.ColumnPrimaryKeyExpression = c => c.Code;
                                    
                                    bulk.BulkMerge(customers);



Bulk Operations from LINQ Query

Perform bulk operations from LINQ Query without loading entities in memory.

var bulk = new BulkOperation<Customer>(connection);
                                            
                                            // DELETE all customers inactive for more than 2 years
                                            bulk.DeleteFromQuery(
                                            c => c.Where(x => x.LastLogin < DateTime.Now.AddYears(-2)));
                                            
                                            // UPDATE all customers inactive for more than 2 years
                                            bulk.UpdateFromQuery(
                                            c => c.Where(x => x.Actif && x.LastLogin < DateTime.Now.AddYears(-2)),
                                            c => new Customer {Actif = false});



AutoMap with Case Insensitive

Sick of not being able to map column because of case sensitivity issue? Use flexible features to customize configuration


var bulk = new BulkOperation(connection);
                                                    bulk.CaseSensitive = CaseSensitiveType.Insensitive;
                                                    bulk.ColumnMappings.Add("cOdE", "Code");
                                                    bulk.BulkMerge(dt);